package com.inpion.gusfot.button;

import com.inpion.gusfot.AbstractBoardElement;

public class BodyButton extends AbstractBoardElement{
	
	private BeforeButton beforeButton;
	private NextButton nextButton;
	private WriteButton writeButton;
	private ListButton listButton;
	public BeforeButton getBeforeButton() {
		return beforeButton;
	}
	public void setBeforeButton(BeforeButton beforeButton) {
		this.beforeButton = beforeButton;
	}
	public NextButton getNextButton() {
		return nextButton;
	}
	public void setNextButton(NextButton nextButton) {
		this.nextButton = nextButton;
	}
	public WriteButton getWriteButton() {
		return writeButton;
	}
	public void setWriteButton(WriteButton writeButton) {
		this.writeButton = writeButton;
	}
	public ListButton getListButton() {
		return listButton;
	}
	public void setListButton(ListButton listButton) {
		this.listButton = listButton;
	}
	
	@Override
	public String getRenderString() {
		String retString = 	"<tr>" +
								"<td>" +
									"<%=BEFORE_BUTTON=%>" +
								"</td>" +
								"<td>" +
									"<%=NEXT_BUTTON=%>" +
								"</td>" +
								"<td>" +
									"<%=WRITE_BUTTON=%>" +
								"</td>" +
								"<td>" +
									"<%=LIST_BUTTON=%>" +
								"</td>" +
							"</tr>";
		
		String beforeButtonString = this.beforeButton.render();
		String nextButtonString = this.nextButton.render();
		String writeButtonString = this.writeButton.render();
		String listButtonString = this.listButton.render();
		
		retString = retString.replaceAll("<%=BEFORE_BUTTON=%>", beforeButtonString);
		retString = retString.replaceAll("<%=NEXT_BUTTON=%>", nextButtonString);
		retString = retString.replaceAll("<%=WRITE_BUTTON=%>", writeButtonString);
		retString = retString.replaceAll("<%=LIST_BUTTON=%>", listButtonString);
		return retString;
	}
}
